package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import org.testng.annotations.Test;

import com.example.fw.Groups;

public class GroupRemovalTests extends TestBase {
	
	@Test (dataProvider = "getSomeExistingGroup", dataProviderClass = GroupDataGenerator.class)
	public void testRandomGroupCanBeRemoved(GroupObject someGroup) throws Exception {
		Groups oldList = app.getGroupHelper().getGroups();
		//action
		app.getGroupHelper().deleteGroup(someGroup);
		//verification
		Groups newList = app.getGroupHelper().getGroups();
		assertThat(newList, equalTo(oldList.withRemoved(someGroup)));
	}
	
}
